<?php use_stylesheet('task.css') ?>
<?php use_stylesheet('tasks.css') ?>
<?php use_helper('Text') ?>
<div id="task">
  <h1 style="background-color:#FFCC66"><?php echo "project: ".$milestone->getProject()->getProjectname() ?></h1>
  <h2><?php echo "version: ".$milestone->getVersion() ?></h2>
  <h3>milestone: <span style="font-weight:normal;"><?php echo $milestone->getName() ?></span><br/>
    <small> - <?php echo "Created by: ". $milestone->getResource()->getName() ?></small>
  </h3>
 
 
  <h4>Tasks</h4>
  <?php include_partial('task/list', array('tasks' => $pager->getResults())) ?>
 
<?php if ($pager->haveToPaginate()): ?>
  <div class="pagination">
    <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid()) ?>?page=1">
      <img src="/images/first.png" alt="First page" title="First page" border="0" />
    </a>
 
    <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid()) ?>?page=<?php echo $pager->getPreviousPage() ?>">
      <img src="/images/previous.png" alt="Previous page" title="Previous page" border="0" />
    </a>
 
    <?php foreach ($pager->getLinks() as $page): ?>
      <?php if ($page == $pager->getPage()): ?>
        <?php echo $page ?>
      <?php else: ?>
        <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid()) ?>?page=<?php echo $page ?>"><?php echo $page ?></a>
      <?php endif; ?>
    <?php endforeach; ?>
 
    <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid()) ?>?page=<?php echo $pager->getNextPage() ?>">
      <img src="/images/next.png" alt="Next page" title="Next page" border="0" />
    </a>
 
    <a href="<?php echo url_for('milestone/show?milestoneid='.$milestone->getMilestoneid()) ?>?page=<?php echo $pager->getLastPage() ?>">
      <img src="/images/last.png" alt="Last page" title="Last page" border="0" />
    </a>
  </div>
  <?php endif; ?>
 
  <div class="pagination_desc">
    <strong><?php echo count($pager) ?></strong> tasks in this milestone
 
    <?php if ($pager->haveToPaginate()): ?>
      - page <strong><?php echo $pager->getPage() ?>/<?php echo $pager->getLastPage() ?></strong>
    <?php endif; ?>
  </div>
  
  
  <hr/>
 
  <div class="meta">
    <small>created on <?php echo $milestone->getDateTimeObject('createdate')->format('m/d/Y') ?></small>
  </div>
 
  <div style="padding: 20px 0">
  <?php
  if ($sf_user->hasPermission("milestone.update"))
  {
  ?>
    <a href="<?php echo url_for('milestone/edit?milestoneid='.$milestone->getMilestoneid()) ?>">Edit</a>&nbsp;
  <?php
  }
  ?>
    <a href="<?php echo url_for('milestone/index') ?>">List</a>
  </div>
</div>